# 作者：石吴震
# 2024年12月31日13时49分18秒
# 474160957@qq.com


class plant():
    def __init__(self, name, blood):
        self.name = name
        self.blood = blood
        self.free_blood = blood

    def __str__(self):
        if self.free_blood<=0:
            return f'{self.name} 被僵尸吃掉了'
        return f'{self.name} 的剩余血量为 {self.free_blood}'

    def fire(self, zombie):
        if zombie.free_blood<=0:
            return
        print(f'{self.name} 向 {zombie.name} 发射一颗豌豆子弹')
        zombie.free_blood -= 3


class zombie():
    def __init__(self, name, blood):
        self.name = name
        self.blood = blood
        self.free_blood = blood

    def __str__(self):
        if self.free_blood<=0:
            return f'{self.name} 被植物击倒了'
        return f'{self.name} 的剩余血量为 {self.free_blood}'

    def eat(self, plant):
        if plant.free_blood<=0:
            return
        print(f'{self.name} 吃了 {plant.name}一口')
        plant.free_blood -= 10



# if __name__ == '__main__':
#     wandousheshou=plant('豌豆射手', 40)
#     jiangshi=zombie('僵尸', 30)
#     wandousheshou.fire(jiangshi)
#     jiangshi.eat(wandousheshou)
#     print(wandousheshou)
#     print(jiangshi)

class zombie_iron(zombie):
    def __init__(self, tool1,*args):
        super().__init__(*args)
        self.tool = tool1
        self.tool_blood = 100

    def __str__(self):
        super().__str__()
        if self.tool_blood<=0:
            return f'{self.name} 的铁桶被打烂了'
        return f'{self.name} 的剩余铁桶血量为 {self.tool_blood}'

    def eat(self, plant):
        super().__str__()

class zombie_jump(zombie):
    def __init__(self, tool2,*args):
        super().__init__(*args)
        self.tool = tool2

    def __str__(self):
        super().__str__()

    def eat(self, plant):
        super().__str__()

class zombie_iron_jump(zombie_iron, zombie_jump):
    def __init__(self, name, *args):
        super().__init__(*args)
        self.name = name

if __name__ == '__main__':
    z1 = zombie_iron_jump('僵尸钻石','铁桶','竹竿',300)
    print(z1.name)
    print(z1.blood)
    print(z1.tool1) #******
    print(z1.tool2)   #******